/**
 * Created by hang on 14-5-11.
 */
var host = "";
$(document).ready(function(){
	host = "http://114.215.121.115/xipujewelWeb";

    setShopCartCount();
});

function deleteShop(id) {
    if (confirm("确认删除？")) {
        $.post(host+"/ShopCart/deleteShop", {id: id},
            function (data) {
                alert(data);
                location.reload();
            });
    }
}

function setShopCartCount(){
    $.post(host + "/ShopCart/getShopCartCount",function (data) {
        if (data != null) {
            $("#shopCartCount").text(data);
            $("#shopCartCount2").text(data);
        }
    });
}

function deleteShops() {
    var chk_value = [];
    $('input[name="shopCarId"]:checked').each(function () {
        if ($(this).val() != '') {
            chk_value.push($(this).val());
        }
    });
    if (chk_value.length == 0) {
        alert("请选择商品");
    } else {
        $.post(host+"/ShopCart/deleteShops", {ids: chk_value.toString()},
            function (data) {
                if (data != null) {
                    alert(data);
                    location.reload();
                }
            });
    }
}


